<?php
	include_once('auth.php');
	
	include_once('config.php');
	
	if (!empty($_POST))
	{
		$video_id = $_POST['videoID'];
		$preview_id = getVimeoIDbyURL(getVideoPreviewLink($video_id));
		
		deleteVideo($video_id);
		
		global $preview_dir;
		
		removeDirectory($preview_dir.$preview_id);
	}
	else
	{
		header('Location: /admin');
		exit();
	}
?>